package com.burges.net.function

import org.apache.flink.api.common.functions.MapFunction
import org.apache.flink.streaming.api.scala.{DataStream, StreamExecutionEnvironment, _}

/**
  * 自定义函数接口方式1
  * 创建人    BurgessLee 
  * 创建时间   2020/1/25 
  * 描述
  */
object FunctionInterfaceByClass {

	def main(args: Array[String]): Unit = {
		val env = StreamExecutionEnvironment.getExecutionEnvironment
		val dataStream: DataStream[String] = env.fromElements("hello", "flink")
		dataStream.map(new MyMapFunction)
	}

	class MyMapFunction extends MapFunction[String,String] {
		override def map(t: String): String = {
			t.toUpperCase()
		}
	}

}
